Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

198
Visualizações
Unable to locate element: {"method":"xpath","selector":"//li[@id="tablist1-tab3"]"} error using Selenium and Java

I have received this error for several times:

Unable to locate element: {"method":"xpath","selector":"//li[@id="tablist1-tab3"]"}

Code that I have used is:

options.addArguments("--headless");
options.addArguments("window-size=1200x900");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement tab = driver.findElement(By.xpath("//li[@id=\"tablist1-tab3\"]"));
tab.click();

Can someone help me with this error?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You need to use WebDriverWait for the elementToBeClickable() and you can use either of the following Locator Strategies:

  • cssSelector:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("li#tablist1-tab3"))).click();
    
  • xpath:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//li[@id=\"tablist1-tab3\"]"))).click();
    
over 4 years ago · Santiago Trujillo Relatório

0

WebElement tab = driver.findElement(By.xpath('//li[@id="tablist1-tab3"]')); try this

over 4 years ago · Santiago Trujillo Relatório

0

Make sure the element is not inside an iFrame. If it is, then you need to first find the iFrame element and use Selenium's switchTo(). After that you will be able to locate elements inside the iframe.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda